function J = Df_mechanism(f, X)
% x = [u v ksi], where u is 2-by-1, z is 3-by-1 and ksi is 2-by-1. The
% problem has a 7i6o structure. Calculate the jacobian matrix of the whole
% zeros finding problem
dX = 0.001*ones(length(X),1);
X_aug = repmat(X',length(X),1) + diag(dX);
fx = f(X);
J = [(f(X_aug(1,:)') - fx)/dX(1),...
     (f(X_aug(2,:)') - fx)/dX(2),...
     (f(X_aug(3,:)') - fx)/dX(3),...
     (f(X_aug(4,:)') - fx)/dX(4),...
     (f(X_aug(5,:)') - fx)/dX(5),...
     (f(X_aug(6,:)') - fx)/dX(6),...
     (f(X_aug(7,:)') - fx)/dX(7),];